package com.chainshop.product.domain;

import com.chainshop.common.annotation.Excel;
import com.chainshop.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * 存储商品变种信息的对象 product_variants
 * 
 * @author chainshop
 * @date 2024-08-12
 */
public class ProductVariants extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 变种ID */
    private Long variantId;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long productId;

    /** 商品属性 */
    @Excel(name = "商品属性")
    private String goodsAttribute;

    /** 变种价格 */
    @Excel(name = "价格")
    private BigDecimal price;
    private Integer unit;

    public void setUnit(Integer unit) {
        this.unit = unit;
    }

    public Integer getUnit() {
        return unit;
    }

    /** 商品进价 */
    @Excel(name = "商品进价")
    private BigDecimal purchasePrice;

    public void setVariantId(Long variantId) 
    {
        this.variantId = variantId;
    }

    public Long getVariantId() 
    {
        return variantId;
    }
    public void setProductId(Long productId) 
    {
        this.productId = productId;
    }

    public Long getProductId() 
    {
        return productId;
    }
    public void setGoodsAttribute(String goodsAttribute) 
    {
        this.goodsAttribute = goodsAttribute;
    }

    public String getGoodsAttribute() 
    {
        return goodsAttribute;
    }
    public void setPrice(BigDecimal price) 
    {
        this.price = price;
    }

    public BigDecimal getPrice() 
    {
        return price;
    }
    public void setPurchasePrice(BigDecimal purchasePrice)
    {
        this.purchasePrice = purchasePrice;
    }

    public BigDecimal getPurchasePrice()
    {
        return purchasePrice;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("variantId", getVariantId())
            .append("productId", getProductId())
            .append("goodsAttribute", getGoodsAttribute())
            .append("price", getPrice())
            .append("purchasePrice", getPurchasePrice())
            .toString();
    }
}